package com.ljf.finance.api.service.impl;

import com.ljf.common.api.service.impl.BasisServiceImpl;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ServiceResultModel;
import com.ljf.common.utils.ServiceResultUtil;
import com.ljf.finance.domain.repository.FinanceDatVirtualAccountRepository;
import com.ljf.finance.domain.service.FinanceDatVirtualAccountDomainService;
import com.ljf.finance.domain.validator.FinanceDatVirtualAccountValidator;
import com.ljf.finance.dto.command.FinanceDatVirtualAccountCommand;
import com.ljf.finance.dto.query.FinanceDatVirtualAccountQuery;
import com.ljf.finance.model.FinanceDatVirtualAccount;
import com.ljf.finance.service.IFinanceDatVirtualAccountService;
import com.ljf.finance.vo.FinanceDatVirtualAccountVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 虚拟账户定义  服务接口实现
 *
 * @author LJF
 * @since 2024-02-09
 */
@Service
public class FinanceDatVirtualAccountServiceImpl extends BasisServiceImpl<FinanceDatVirtualAccountDomainService, FinanceDatVirtualAccountValidator, FinanceDatVirtualAccountRepository, FinanceDatVirtualAccountQuery, FinanceDatVirtualAccountVO, FinanceDatVirtualAccount, FinanceDatVirtualAccountCommand> implements IFinanceDatVirtualAccountService {

    /**
     * 常用账户查询
     *
     * @param query
     * @return
     * @throws ServiceException
     */
    @Override
    public ServiceResultModel<FinanceDatVirtualAccountVO> queryCommonUsed(FinanceDatVirtualAccountQuery query) throws ServiceException {
        validator.checkQueryCommonUsed(query);
        List<FinanceDatVirtualAccountVO> page = domainService.queryCommonUsed(query);
        return ServiceResultUtil.success(page);
    }

}
